import { sideOptions } from '../../backstageSupport/components/configs'
import { mapGetters } from 'vuex'

export default { 
  data() {
    return {
      sideOptions
    }
  },
  computed: {
    ...mapGetters('user', ['account', 'role', 'userName']),
  },
  methods: {
    // 通过key获取页面路由信息
    getPath(key) {
      for (let i = 0; i < this.sideOptions.length; i++) {
        const option = this.sideOptions[i]
        for (let j = 0; j < option.child.length; j++) {
          const element = option.child[j]
          if (element.key === key) {
            return element
          }
        }
      }
      return {
        toRouter: '',
        key
      }
    },
  }
}